Skip to content

feat(player): respawn at a personal spawn point set by a bed - #153

Open
xRookieFight wants to merge 1 commit into
devfrom
feat/beds
Open

feat(player): respawn at a personal spawn point set by a bed#153
xRookieFight wants to merge 1 commit into
devfrom
feat/beds

Conversation

@xRookieFight

Copy link
Copy Markdown
Contributor

Description

Respawning always dropped the player at the generator's spawn column, and there was no way to change that. This adds the personal spawn point and the two ways to set one.

  • Players carry a spawn point, unset until something sets it. Respawn uses it when it is still somewhere they can stand and falls back to the world spawn otherwise, so a bed that has since been mined into does not strand anyone inside a wall.
  • Right clicking a bed sets it, with the vanilla confirmation message. Outside the overworld the attempt is refused with %tile.bed.noSleep rather than silently accepted.
  • /spawnpoint [player] [x y z] sets it explicitly, defaulting to the target's current position. The write goes through the target's own world runtime, so the console and another player's session thread both reach it the same way.
  • The spawn point saves and loads with the rest of the player data.

Related issue

Part of #142

Deliberately not in this PR, because each depends on work tracked elsewhere:

Checklist

  • v -check . is clean
  • v test server/player, server/cmd/default, server/session/combat_test.v, items_test.v are green
  • Follows the conventions in AGENTS.md (OOP, pub/capitalized exports, no import cycles, minimal comments)
  • Cross-session gameplay state is only mutated on its owning world's actor thread (via world_call/wr.submit/WorldTx), never through a global Hub actor
  • No unrelated changes bundled in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant